import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer'
import api from './apis'

// function getURLProxy() {
//   const { pathname } = window.location
//   const index = pathname.indexOf('/view/file')
//   return pathname.slice(0, index)
// }
const MockApis = api.map(item => ({
  ...item,
  url: item.url,
}))
export function setupProdMockServer() {
  // eslint-disable-next-line no-console
  console.log(MockApis)
  createProdMockServer(MockApis)
}
